home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIObjectInputStream.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  160 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIObjectInputStream.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIObjectInputStream_h__
  6. #define __gen_nsIObjectInputStream_h__
  7.  
  8.  
  9. #ifndef __gen_nsIBinaryInputStream_h__
  10. #include "nsIBinaryInputStream.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsrootidl_h__
  14. #include "nsrootidl.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21.  
  22. /* starting interface:    nsIObjectInputStream */
  23. #define NS_IOBJECTINPUTSTREAM_IID_STR "6c248606-4eae-46fa-9df0-ba58502368eb"
  24.  
  25. #define NS_IOBJECTINPUTSTREAM_IID \
  26.   {0x6c248606, 0x4eae, 0x46fa, \
  27.     { 0x9d, 0xf0, 0xba, 0x58, 0x50, 0x23, 0x68, 0xeb }}
  28.  
  29. /**
  30.  * @see nsIObjectOutputStream
  31.  * @see nsIBinaryInputStream
  32.  */
  33. class NS_NO_VTABLE nsIObjectInputStream : public nsIBinaryInputStream {
  34.  public: 
  35.  
  36.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IOBJECTINPUTSTREAM_IID)
  37.  
  38.   /**
  39.      * Read an object from this stream to satisfy a strong or weak reference
  40.      * to one of its interfaces.  If the interface was not along the primary
  41.      * inheritance chain ending in the "root" or XPCOM-identity nsISupports,
  42.      * readObject will QueryInterface from the deserialized object root to the
  43.      * correct interface, which was specified when the object was serialized.
  44.      *
  45.      * @see nsIObjectOutputStream
  46.      */
  47.   /* nsISupports readObject (in PRBool aIsStrongRef); */
  48.   NS_IMETHOD ReadObject(PRBool aIsStrongRef, nsISupports **_retval) = 0;
  49.  
  50.   /* [notxpcom] nsresult readID (out nsID aID); */
  51.   NS_IMETHOD_(nsresult) ReadID(nsID *aID) = 0;
  52.  
  53.   /**
  54.      * Optimized deserialization support -- see nsIStreamBufferAccess.idl.
  55.      */
  56.   /* [notxpcom] charPtr getBuffer (in PRUint32 aLength, in PRUint32 aAlignMask); */
  57.   NS_IMETHOD_(char *) GetBuffer(PRUint32 aLength, PRUint32 aAlignMask) = 0;
  58.  
  59.   /* [notxpcom] void putBuffer (in charPtr aBuffer, in PRUint32 aLength); */
  60.   NS_IMETHOD_(void) PutBuffer(char * aBuffer, PRUint32 aLength) = 0;
  61.  
  62. };
  63.  
  64. /* Use this macro when declaring classes that implement this interface. */
  65. #define NS_DECL_NSIOBJECTINPUTSTREAM \
  66.   NS_IMETHOD ReadObject(PRBool aIsStrongRef, nsISupports **_retval); \
  67.   NS_IMETHOD_(nsresult) ReadID(nsID *aID); \
  68.   NS_IMETHOD_(char *) GetBuffer(PRUint32 aLength, PRUint32 aAlignMask); \
  69.   NS_IMETHOD_(void) PutBuffer(char * aBuffer, PRUint32 aLength); 
  70.  
  71. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  72. #define NS_FORWARD_NSIOBJECTINPUTSTREAM(_to) \
  73.   NS_IMETHOD ReadObject(PRBool aIsStrongRef, nsISupports **_retval) { return _to ReadObject(aIsStrongRef, _retval); } \
  74.   NS_IMETHOD_(nsresult) ReadID(nsID *aID) { return _to ReadID(aID); } \
  75.   NS_IMETHOD_(char *) GetBuffer(PRUint32 aLength, PRUint32 aAlignMask) { return _to GetBuffer(aLength, aAlignMask); } \
  76.   NS_IMETHOD_(void) PutBuffer(char * aBuffer, PRUint32 aLength) { return _to PutBuffer(aBuffer, aLength); } 
  77.  
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  79. #define NS_FORWARD_SAFE_NSIOBJECTINPUTSTREAM(_to) \
  80.   NS_IMETHOD ReadObject(PRBool aIsStrongRef, nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadObject(aIsStrongRef, _retval); } \
  81.   NS_IMETHOD_(nsresult) ReadID(nsID *aID) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadID(aID); } \
  82.   NS_IMETHOD_(char *) GetBuffer(PRUint32 aLength, PRUint32 aAlignMask) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBuffer(aLength, aAlignMask); } \
  83.   NS_IMETHOD_(void) PutBuffer(char * aBuffer, PRUint32 aLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->PutBuffer(aBuffer, aLength); } 
  84.  
  85. #if 0
  86. /* Use the code below as a template for the implementation class for this interface. */
  87.  
  88. /* Header file */
  89. class nsObjectInputStream : public nsIObjectInputStream
  90. {
  91. public:
  92.   NS_DECL_ISUPPORTS
  93.   NS_DECL_NSIOBJECTINPUTSTREAM
  94.  
  95.   nsObjectInputStream();
  96.  
  97. private:
  98.   ~nsObjectInputStream();
  99.  
  100. protected:
  101.   /* additional members */
  102. };
  103.  
  104. /* Implementation file */
  105. NS_IMPL_ISUPPORTS1(nsObjectInputStream, nsIObjectInputStream)
  106.  
  107. nsObjectInputStream::nsObjectInputStream()
  108. {
  109.   /* member initializers and constructor code */
  110. }
  111.  
  112. nsObjectInputStream::~nsObjectInputStream()
  113. {
  114.   /* destructor code */
  115. }
  116.  
  117. /* nsISupports readObject (in PRBool aIsStrongRef); */
  118. NS_IMETHODIMP nsObjectInputStream::ReadObject(PRBool aIsStrongRef, nsISupports **_retval)
  119. {
  120.     return NS_ERROR_NOT_IMPLEMENTED;
  121. }
  122.  
  123. /* [notxpcom] nsresult readID (out nsID aID); */
  124. NS_IMETHODIMP_(nsresult) nsObjectInputStream::ReadID(nsID *aID)
  125. {
  126.     return NS_ERROR_NOT_IMPLEMENTED;
  127. }
  128.  
  129. /* [notxpcom] charPtr getBuffer (in PRUint32 aLength, in PRUint32 aAlignMask); */
  130. NS_IMETHODIMP_(char *) nsObjectInputStream::GetBuffer(PRUint32 aLength, PRUint32 aAlignMask)
  131. {
  132.     return NS_ERROR_NOT_IMPLEMENTED;
  133. }
  134.  
  135. /* [notxpcom] void putBuffer (in charPtr aBuffer, in PRUint32 aLength); */
  136. NS_IMETHODIMP_(void) nsObjectInputStream::PutBuffer(char * aBuffer, PRUint32 aLength)
  137. {
  138.     return NS_ERROR_NOT_IMPLEMENTED;
  139. }
  140.  
  141. /* End of implementation class template. */
  142. #endif
  143.  
  144. inline nsresult
  145. NS_ReadOptionalObject(nsIObjectInputStream* aStream, PRBool aIsStrongRef,
  146.                       nsISupports* *aResult)
  147. {
  148.     PRBool nonnull;
  149.     nsresult rv = aStream->ReadBoolean(&nonnull);
  150.     if (NS_SUCCEEDED(rv)) {
  151.         if (nonnull)
  152.             rv = aStream->ReadObject(aIsStrongRef, aResult);
  153.         else
  154.             *aResult = nsnull;
  155.     }
  156.     return rv;
  157. }
  158.  
  159. #endif /* __gen_nsIObjectInputStream_h__ */
  160.